package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// BlingPromotionSection map toml [bling-promotion]
type BlingPromotionSection struct {
	Host  string
	Port  string
}

// ReadBlingPromotionSection get bling-promotion section from config
func ReadBlingPromotionSection(v *viper.Viper, slog *zap.SugaredLogger) (blingPromotionConf BlingPromotionSection) {
	err := v.Unmarshal(&blingPromotionConf)
	if err != nil {
		slog.Panicf("unable to decode into bling-promotion section, %v", err)
	}
	slog.Debug(blingPromotionConf)
	return
}